Repository navigation
fix(control-plane): stabilize v2.4.0 replan, monitor recovery, and staged-read slice (Slice B5) - #9160
Conversation
…aged-read slice (Slice B5) Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent, Gemini, Google (self_reported)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
针对精确头 9160@609aa305670098cb3037e6d2ecc3f925c03a6373(base main ddba6bf3964baa59e0d86979119aa027422d2aa5)的独立代码审查与本地全量实测已完成。PR #9160 围绕 LoopX v2.4.0 稳定化 Slice B5,完成了四组局部且自洽的控制面/CLI 修复(渐进式上下文捕获与 --begin-turn 内联保留、guard_scoped semantic replan writeback 的 projected_ack 透传、unsettled monitor_poll 恢复动作附带活跃 hard_lease 凭据及 auxiliary monitor 组合结算标记、state_refresh.py 重构后的 mutant locator 更新),并将 17 个配套测试/夹具对齐到当前已合入的 quota_settlement_plan_v2、loopx_turn_envelope_v1、replan_cli_view 与 context-read 契约。经本地隔离环境实测、反向反事实探针、静态检查及 canary premerge 全量通过,未发现阻断合入的缺陷。
动机 / Motivation
- 受影响对象与触发任务:启用 progressive context 或在受保护的 replan writeback、hard_lease monitor_poll 恢复及 auxiliary monitor settlement 路径上执行自动心跳的 LoopX Control-Plane 与 CLI 调用方。
- 前后场景与实际代价:修前场景中,当 --begin-turn 引导启动在缺少原生 Codex 会话目录(directory is None)的情况下触发 project_native_quota_context 时,prepare_codex_context 不会透传 captured_decision,且若无保护条件则会错误剥离 内联 settlement_plan;当 guard_scoped 为真时,qualify_replan_writeback 未把已记录的前序运行历史 replan ACK 经由 projected_ack 传入 Goal-Frontier 上下文;而 unsettled_host_turn 的 monitor_poll 恢复命令未携带 hard_lease 所需的 --task-lease-idempotency-key 与 --task-lease-expected-version,导致后续 refresh-state / monitor-poll 无法直接闭合。修后上述三条核心控制面链路与 auxiliary monitor 恢复及 17 份测试/locator 夹具均与当前契约对齐并一次通过。
- 可观测结果:无原生上下文会话的 --begin-turn 引导启动保留内联 settlement_plan 且不生成 settlement_read_ref,而常规渐进读取通过 _saved_decision_reference 校验(UID、0o077 权限掩码、非 symlink、MAX_REQUEST_BYTES 与 SHA-256)后由 TS 侧安全分阶段投影;guard_scoped replan 写回仅透传真实历史的 projected_ack 而不伪造当前未确认义务的 ACK;monitor_poll 恢复仅在存在活跃 hard_lease 且 state==ready 时附带 lease_proof;_attach_auxiliary_monitor_settlement_resume 启用 composed_settlement=True。
- 非目标边界:本 PR 仅聚焦 v2.4.0 稳定化 Slice B5 的控制面/CLI 修复及对应测试、mutant locator 对齐,不引入新协议版本、不放宽任何权限或 lease 校验边界、不修改其他切片或 benchmark 目录,也不修改控制面之外的扩展与前端页面。
若维持主干现状不修复,自动 Turn 在 hard_lease 模式下遇到未结算的 monitor_poll 恢复时会在下一步写回被缺少租约参数的 CLI 模板卡死;同时无原生会话下的 --begin-turn 启动或 guard_scoped replan 写回在上下文投影与历史 ACK 衔接上存在回归失败,使自动化链路产生无效重试或阻塞。本切片在不引入新协议与状态机的前提下清除了这四类实际运行摩擦。
改动思路 / Approach
本 PR 采用“严格复用既存 typed owner、最小局部修补、零新增状态机/词汇”的收敛策略:
| 机制 | 所属边界 | 触发条件与默认隔离 | 失败与回滚语义 |
|---|---|---|---|
| 渐进上下文与引导启动保护 | quota_capture.py / quota_native_context.py / codex_context.py |
仅当 progressive_enabled=True、非 vision 详情、且(存在原生上下文目录或非 --begin-turn)时计算并传递校验后的 decision_ref;context-project 显式 --select/--list 时跳过改写 |
_saved_decision_reference 任一安全检查失败均返回 None 并安全回退全量上下文,绝不中断 Turn 或泄露非私有文件 |
| 受保护 replan 写回历史 ACK 透传 | semantic_replan_writeback.py |
仅在 guard_scoped and guard_semantic_replan_obligation_id 时通过 latest_autonomous_replan_ack_from_status_payload 提取已记录的 projected_ack 传入 item |
不修改 historical_ack_candidates,若无真实匹配当前义务的历史 ACK 或语义 delta,TS project_replan_semantics 仍严格拒收写回 |
monitor_poll 恢复与辅助结算对齐 |
unsettled_host_turn.py / unsettled_host_turn_contract.py / interaction_contract.py / quota.py |
仅当 not attention and repair == "monitor_poll" 且 project_selected_todo_execution_preparation 返回 handoff_mode == "hard_lease" 与 state == "ready" 时附带 lease_proof;辅助简历启用 composed_settlement=True |
仅作用于命令渲染层;真实写回仍由 guard_first_writeback_execution 与 monitor_poll 原子校验当前活跃租约与原 Turn prepared_lease |
| Locator 与测试夹具对齐 | mutants.py / 17 份 tests/control_plane/ 文件 |
与主干已交付的 state_refresh.py、quota_settlement_plan_v2、replan_cli_view 等契约对齐 |
保持各自独立断言强度与正反向用例,无跳过、无放松 mock |
- 架构判断理由:所有生产改动均直接复用既存 typed owner:_saved_decision_reference 复用 open_regular_capture/private_capture_uid 校验,并把分段裁剪决策留在 turn_envelope.ts;_build_writeback_projection_context 复用 latest_autonomous_replan_ack_from_status_payload 而不越权修改 historical_ack_candidates;_apply_recovery_projection 与 recovery_cli_actions 仅读取 project_selected_todo_execution_preparation 的活跃 hard_lease 只读事实并交由写回门禁复核;_attach_auxiliary_monitor_settlement_resume 复用 composed_settlement=True 开关。
- 当前 PR 边界:当前 PR 边界严格限定于 Slice B5 的 8 个 loopx 运行时/CLI 模块、1 个 mutant locator 示例以及 17 个 control_plane 测试与夹具文件,无新增 Enum/Literal/as const 词汇,职责归属清晰且可独立回滚。
具体改动 / Changes
- 规范映射说明(
spec_basis: no_spec):本 PR 属于v2.4.0发布前既有控制面契约的稳定化修复与测试对齐,仓库中不存在针对 Slice B5 单独签发的 RFC 或新增设计规范文档,各修复点分别对齐既存控制面实现与AGENTS.md边界要求。 - 变更分布(26 个文件,+472 / -153):8 个
loopx/生产文件(+248 / -66)、1 个examples/mutant locator 文件(+2 / -2)、17 个tests/control_plane/夹具与测试文件(+222 / -85)。
关键代码讲解
-
_saved_decision_reference与project_native_quota_context(quota_capture.py)- 在生成原生上下文视图前,
_saved_decision_reference校验private_capture_supported()、合法BARE_SHA256_PATTERN、parent.resolve(strict=True)、排除is_symlink(),并通过open_regular_capture打开描述符后基于os.fstat核验st_uid == uid、not (st_mode & 0o077)、st_size <= MAX_REQUEST_BYTES、实际读取字节数及 SHA-256 摘要,全通过才返回('path', 'sha256')。 project_native_quota_context仅在progressive_enabled and (directory is not None or not bool(getattr(args, "begin_turn", False))) and "vision" not in quota_detail_sections_from_args(args)时传递decision_ref,从而避免无原生上下文目录的--begin-turn引导启动被误折叠settlement_plan;同时保留显式private_capture_uid as private_capture_uid等 re-export 与-> str | None返回以通过严格mypy。- 配套侧 quota_native_context.py 在
args.select或args.list_fields时不传入captured_decision,并在 hook 路径补齐directory is None与request is not None空值防御;codex_context.py 修补了isinstance(previous, dict)、read_plan is not None守卫并在directory is None分支向capture_progressive_context透传selection_command_args_template与captured_decision。
- 在生成原生上下文视图前,
-
_build_writeback_projection_context与qualify_replan_writeback(semantic_replan_writeback.py)- 从
qualify_replan_writeback抽出_build_writeback_projection_context(保持函数决策点数量位于可维护性棘轮<60上限内,经control-plane-maintainability-ratchet-smoke.py验证unreviewed_count=0)。 - 仅当
guard_scoped and guard_semantic_replan_obligation_id成立时,通过latest_autonomous_replan_ack_from_status_payload读取owned_history中同一goal_id/agent_id的既有持久化projected_ack注入item["autonomous_replan_ack"]。由于goal_frontier明确将projected_replan_ack与historical_ack_candidates隔离,既避免了早先历史义务干扰当前前沿衍生,也绝不会为尚未确认的受保护义务伪造acknowledged=True。
- 从
-
_apply_recovery_projection与recovery_cli_actions(unsettled_host_turn.py、unsettled_host_turn_contract.py、interaction_contract.py)- 当未结算恢复处于非阻塞态(
not attention)且recovery.get("repair") == "monitor_poll"时,_apply_recovery_projection查询project_selected_todo_execution_preparation,仅在返回handoff_mode == "hard_lease"、state == "ready"且存在映射型lease_proof时将其透传给交互契约与recovery_cli_actions。 recovery_cli_actions据此为恢复路径的quota monitor-poll --execute与降级回退路径refresh-state --classification monitor_observation_unavailable同时渲染--task-lease-idempotency-key与--task-lease-expected-version,避免人工二次查询租约,且真实写回门禁仍在写入前独立验真。
- 当未结算恢复处于非阻塞态(
-
_attach_auxiliary_monitor_settlement_resume(quota.py)- 在调用
build_turn_scoped_cli_settlement_plan生成辅助 Monitor 恢复简历时补充composed_settlement=True,使其next_step与quota_settlement_plan_v2组合结算路径(单条refresh-state --settle-turn依次完成校验、写回与扣费)保持一致,并保持模块在1427行上限内。
- 在调用
-
Mutant Locator 与测试对齐(mutants.py 及 17 份
tests/control_plane/文件)- 更新
public_refresh_writes_owned_paragraph的before匹配串以对齐loopx/state_refresh.py现有缩进与上下文,并实测通过test_shadow_mutant_locators.py。 - 其余 16 份测试与
replan_packet_fixture.py均按照当前生产契约(effect_id、quota_settlement_plan_v2、monitor_schedule_gap_items_ref、vision_authoring_ref、detail_ref重定位等)更新断言,未发现削弱断言或隐藏跳过的改动。
- 更新
对主干的风险 / Risks
- 阻断性发现:无阻断性(P0/P1)缺陷。
- 非阻断性风险与边界核验:
- 安全与权限边界(已反事实验证):实测确认
_saved_decision_reference会拒绝非0o077私有权限(如0o644)、symlink 替身及 SHA-256 不匹配的decision.json;_apply_recovery_projection在soft_claim、非ready租约或异主租约下不附带lease_proof,写回阶段仍经guard_first_writeback_execution二次比对活跃租约与原 Turn 凭据;_build_writeback_projection_context在携带前序义务 ACK 时仍拒绝未确认的当前guard_scoped义务。 - Default-Off 隔离与语义对齐(
default_off_isolation: isolated,semantic_alignment: aligned):当--context-delivery off(progressive_enabled=False)或传入--include-detail vision时,decision_ref恒为None,实测输出保持原始契约不变。扫描全部 diff 未发现新增Enum/Literal/as const,semantic-vocabulary-drift-smoke.py通过(29/29 词汇,56/56 属主符号)。 - 类型守卫微小细节(非阻断):
unsettled_host_turn_contract.py#L104使用isinstance(lease_proof.get("expected_version"), int),在 Python 中bool是int子类;虽当前唯一上游project_selected_todo_execution_preparation经 TypeScriptrequireInteger严格保证输出整数>= 1(正常路径不可达bool),后续顺手可补and not isinstance(lease_proof.get("expected_version"), bool)提升防御一致性。 - 基线演进与混合合并检查:审查期间远端
origin/main已前移至982b539248(PR#9158),经执行git merge-tree --write-tree origin/main HEAD验证可无冲突干净合并(tree6ebf75a5...),并逐一交叉核对了共同触及的state_refresh.py、quota_result_delivery.py、goal_frontier/__init__.py、execution_preparation.py,确认#9158的prior_rearm_ack与本 PR 的projected_ack语义互补、无碰撞;同时本地测试基线运行在精确头609aa305670098cb3037e6d2ecc3f925c03a6373(基于ddba6bf3964baa59e0d86979119aa027422d2aa5)。 - 测试夹具长路径敏感度观测(预存行为,非 PR 回归):在极长隔离
TMPDIR下初跑 Batch 1 时,test_replan_semantic_action_behavior.py::test_real_tool_loop_selects_composition_gap_and_creates_bound_successor[on/off]因既有测试框架replan_semantic_action_behavior.py:1763将_HostToolError输出截断在4096字节,导致超长路径下错误 JSON 中的context_recovery.select_command被截尾而触发JSONDecodeError;使用较短临时目录TMPDIR复跑该两例均以2 passed通过,确认非本 PR 回归。
- 安全与权限边界(已反事实验证):实测确认
我的整体评价 / Verdict
- 长程与用户体验影响:
long_horizon: improved(修复了未结算monitor_poll在hard_lease下的恢复卡顿、guard_scopedreplan 写回缺失历史 ACK 投影,以及辅助监控恢复的组合结算对齐,显著减少长程自动化卡死与无效重试);user_experience: preserved(--begin-turn引导启动与显式--select/--list/--include-detail vision保留预期 CLI 输出,visual_review: not_applicable,原因为:本次变更仅覆盖控制面调度、CLI 上下文捕获与测试夹具(loopx/cli_commands/quota_capture.py、loopx/cli_commands/quota_native_context.py、loopx/control_plane/*、loopx/quota.py、examples/ 和 tests/),不涉及任何前端页面或渲染视图变更。;未验证范围:none(纯 CLI 与控制面后端逻辑,无渲染视图面))。 - 代码体积与可维护性:
code_volume: necessary、change_proportionality: proportionate,所有变更收敛于既有控制面与 CLI 边界,未新增兼容版本或平行决策者;复用已有词汇表(reuse_existing),control-plane-maintainability-ratchet-smoke.py报告ok=true(unreviewed_count=0、magnitude_regression_count=0)。 - 精确头
609aa305670098cb3037e6d2ecc3f925c03a6373本地实测汇总:- TypeScript 控制面:
npm run typecheck:control-planePASS;tests/control_plane_ts/*.test.ts全量npm run test:control-planePASS(6692 passed, 0 failed, 93 skipped,pre-existing skips);6 份核心控制面套件定向实测 PASS(187 passed, 0 failed)。 - Python 控制面 pytest(隔离
HOME/XDG环境):Batch 2 10 份模块 PASS(179 passed, 0 failed, 0 skipped);Batch 1 11 份模块(含完整test_quota_settlement_cli.py)533 passed,上述 2 例受测试夹具 4096B 长路径截断影响的用例在短TMPDIR下独立复跑 PASS(2 passed, 0 failed,合并535 passed;21 份模块合计714 passed)。 - 静态与门禁:
ruff check(26 个.py文件)PASS;mypy(17 个严格模块)与mypy --follow-imports=silent(8 个改动loopx/模块)PASS(0 errors);scripts/check_rfc_bilingual.py --base origin/main --head HEADPASS;loopx check --scan-root .PASS(0 errors);在挂接node_modules条件下loopx canary premerge --from-git-diff --git-diff-base origin/mainPASS(ok=true,selected=19,failures=0,direct_checks=6/6,catalog_canaries=10/10,risk_profile_smokes=8/8,boundary_run=1/1);semantic-vocabulary-drift-smoke.pyPASS;Goal CQR 收据cqr_93369634df5057a6b1e5校验valid(精确匹配 26 个文件与指纹93369634df5057a6b1e5a50af8880f5f0bc4886bb749db976f4c4747a9c90c45)。远程 GitHub Actions CI 按 Goalwait_for_ci: false策略未等待(UNVERIFIED/not_consulted)。
- TypeScript 控制面:
English verdict: APPROVE — Exact head 609aa305670098cb3037e6d2ecc3f925c03a6373 has zero blocking findings across all 26 files; progressive capture/guided-start isolation, guarded replan ACK propagation, hard-lease monitor recovery, auxiliary composed settlement, and mutant/test contract alignments are all verified by local TS/Python suites, counterfactual probes, static checks, and premerge canaries.
* fix(cli): preserve typed runtime diagnostics in Turn failures Signed-off-by: LoopX Agent <[email protected]> * feat(steward): support per-endpoint model preferences and Codex-to-Antigravity failover (#9141) Signed-off-by: LoopX Agent <[email protected]> * Keep the prepared Chat adapter available to a retry (#9134) A failed worker start can finish cleanup after a same-turn retry has selected the adapter. Keep its lifetime tied to the Session and let failed dispatch release its own worker registration. The regression asserts one upstream turn and explicit adapter closure with the Session. Port the fix from 4453e4bdd77486ec14b952f88ca893310b32e26c. (cherry picked from commit 173e42b4f051b885c3a3389e1cad9c5722f7b7dd) Signed-off-by: LoopX Agent <[email protected]> * fix(steward): recover zero-effect monitors and cleared-replan reports (#9143) Signed-off-by: LoopX Agent <[email protected]> * fix(steward): admit flexible_primary_available executor transitions in conversation_scope (#9145) Signed-off-by: LoopX Agent <[email protected]> * Verify quota gate scope through signed lane references (#9101) * test(quota): verify scoped gates through complete lane references Signed-off-by: LoopX Agent <[email protected]> * Test canonical quota gates in both public response modes Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Test C1 planning and Host input from the original quota capture (#9102) * Use recorded quota decisions in the no-Todo settlement regression Signed-off-by: LoopX Agent <[email protected]> * Exercise the complete Host prompt from the captured quota source Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Prepare the CLI budget baseline with a private Git index (#9103) Signed-off-by: LoopX Agent <[email protected]> * Exercise C1 Goal delivery and bound replan from the saved source (#9104) Signed-off-by: LoopX Agent <[email protected]> * Keep long claim overlap scopes on demand (#9086) * Link long thin-claim overlap lists to their receipts Signed-off-by: LoopX Agent <[email protected]> * Read claim overlap details without copying the lease Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(quota): preserve explicit Monitor Todo selection (#9099) Carry Todo selection provenance into quota admission. Preserve explicit secondary Monitor polling and recovery from previously admitted receipts. Signed-off-by: LoopX Agent <[email protected]> * Keep ready Todo scope details on the required context read (#9106) Signed-off-by: LoopX Agent <[email protected]> * Fix archive rollback with custom install directories (#9066) * refactor(core): defer benchmark implementations during capability discovery Preserve the benchmark toolkit public exports and static types while keeping execution and experiment implementations out of metadata discovery. Qualify source and installed Core paths, and reconcile the paired minimal/Standard RFC boundary without changing activation or authority defaults. Signed-off-by: cicolord <[email protected]> * Defer Yardstick evaluation until an enabled Explore read Signed-off-by: cicolord <[email protected]> * Omit empty Todo summary lanes from ordinary Worker context Signed-off-by: cicolord <[email protected]> * fix(update): honor configured archive directories during rollback Signed-off-by: LoopX Agent <[email protected]> * fix(lark): replay recall guard on current main Signed-off-by: huangruiteng <[email protected]> * docs: record the verified LoopX 2.3.0 release baseline Signed-off-by: LoopX Agent <[email protected]> * Preserve quota spend source when prepared work is admitted Signed-off-by: LoopX Agent <[email protected]> * test(quota): qualify native saved complete-Turn checkpoints Signed-off-by: LoopX Agent <[email protected]> * Retry cleanup of an owned file mutation marker Signed-off-by: LoopX Agent <[email protected]> * Keep synthetic Git-path test data outside the public source scan Signed-off-by: LoopX Agent <[email protected]> * fix(quota): share native preparation wait with readiness Signed-off-by: LoopX Agent <[email protected]> * fix(doctor): bind package update readback to its Python environment Signed-off-by: LoopX Agent <[email protected]> * Keep Doctor discovery separate from service activation Signed-off-by: LoopX Agent <[email protected]> * Verify the recorded Python launcher before Doctor probes it Signed-off-by: LoopX Agent <[email protected]> * fix(desktop): require runtime qualification for macOS preview updates Signed-off-by: LoopX Agent <[email protected]> * fix(quota): reuse replan projection owners during recovery Signed-off-by: LoopX Agent <[email protected]> * Qualify Codex 0.169 native context replay on main Signed-off-by: LoopX Agent <[email protected]> * Stop regenerating retired quota view aliases Signed-off-by: LoopX Agent <[email protected]> * fix: pin deferred native context reads to the original capture Signed-off-by: LoopX Agent <[email protected]> * Keep native capture navigation within small output budgets Signed-off-by: LoopX Agent <[email protected]> * Retire legacy heartbeat work prompt generation Signed-off-by: LoopX Agent <[email protected]> * Capture C1 composition failures as receipt diagnostics Signed-off-by: LoopX Agent <[email protected]> * Recover interrupted native Todo readiness from the original Turn Signed-off-by: LoopX Agent <[email protected]> * Revalidate the original lease before publishing resumed native context Signed-off-by: LoopX Agent <[email protected]> * Fence native readiness publication with the canonical lease writer Signed-off-by: LoopX Agent <[email protected]> * fix(scheduler): keep Codex fallback on the original C1 runtime Signed-off-by: LoopX Agent <[email protected]> * fix(scheduler): pin the originating fallback launchers Signed-off-by: LoopX Agent <[email protected]> * Retire the duplicate Codex App scheduler projection Signed-off-by: LoopX Agent <[email protected]> * Seed the recorded scheduler profile in the elapsed-backoff fixture Signed-off-by: LoopX Agent <[email protected]> * Verify canonical cadence on refused and settled Turns Signed-off-by: LoopX Agent <[email protected]> * Pin named Core commands in saved scheduler fallbacks Signed-off-by: LoopX Agent <[email protected]> * fix(research): preserve saved case addresses when a version cannot open Signed-off-by: LoopX Agent <[email protected]> * Preserve citation focus after a saved study refresh Signed-off-by: LoopX Agent <[email protected]> * Capture authenticated LoopX receipts for Research attention (#8790) * feat(research): capture authenticated LoopX attention receipts Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * fix(research): tighten attention receipt provenance Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * fix(research): publish attention captures after source validation Signed-off-by: huangruiteng <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: huangruiteng <[email protected]> Co-authored-by: TRAE CLI <[email protected]> Co-authored-by: huangruiteng <[email protected]> * Recover the original Session and Turn from a confirmed Chat task Signed-off-by: huangruiteng <[email protected]> * perf(lark,native_chat): eliminate redundant full-directory JSON reparsing in steward chat loops (#9041) * perf(lark,native_chat): avoid full directory reparsing in steward chat loops - Make LarkOwnerAttention._route iterate capture candidates lazily so matching stops at the newest valid p2p capture. - Reuse FileChatDiscovery in PrivateIngressObserver._records while preserving strict field validation and fail-closed errors. - Reuse FileChatDiscovery in ChatExternalConversations.pending so unchanged request journals skip redundant JSON reads and stay mutation-isolated. - Add regression and scan-efficiency tests in tests/test_lark_steward_directory_scan_perf.py. Signed-off-by: LoopX Agent <[email protected]> * fix(native-chat): project small recovery metadata fields to stop data_url memory growth Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Retire transitional smoke checks and duplicate execution (#9073) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * feat(steward): support probe-gated generic continuous_monitor todos with handoff and user actions (#9074) Signed-off-by: LoopX Agent <[email protected]> * Remove redundant defensive prose from prompts and comments (#9072) Remove redundant defensive prose while preserving published heartbeat wrappers and externally managed skill readiness. Validated with 197 related tests, independent historical wrapper migrations and negative cases, installed-skill readback, and current-main quick canary. Existing CI qualification and infrastructure limitations remain recorded in PR #9072. Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: Lusen Dong <[email protected]> * Keep original Chat retry errors visible during receipt refresh Signed-off-by: LoopX Agent <[email protected]> * fix(steward): tolerate report validator python drift and allow cancel of mid-turn failed reports (#9077) Signed-off-by: LoopX Agent <[email protected]> * feat(steward): add exact-head PR review signals and protected merge confirmation (#9081) Signed-off-by: LoopX Agent <[email protected]> * feat(steward): add isolated OpenViking long-term memory with per-speaker boundaries (#9083) Signed-off-by: LoopX Agent <[email protected]> * refactor(content-ops): slim surface module and eliminate Any (#8961) * refactor(content-ops): slim surface module and eliminate Any Signed-off-by: LoopX Agent <[email protected]> * fix(content-ops): reject malformed angle source_item_ids containers Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(collaboration): batch handoff query Goal lifetime guard lock per Goal (#9085) Signed-off-by: LoopX Agent <[email protected]> * fix(hosts): raise managed service startup readiness timeout to 45s (#9087) Signed-off-by: LoopX Agent <[email protected]> * perf(manager-context): memoize history_inspect lifecycle checks and scope runtime revision in handoffs query (#9088) Eliminate the remaining O(N) Effect runtime RPCs and uncached runtime fingerprinting inside tracking.query(): enter effect_runtime_request_scope() for the query, memoize pure history_inspect lifecycle decisions across entries sharing identical Goal refs while holding the Goal lifetime guard, lazily discover legacy ingress files only when external audience recovery needs them, and preserve entry scan order across Goal batches. Signed-off-by: LoopX Agent <[email protected]> * refactor(lark): slim private_conversations below 2000 lines with net LOC reduction (#8929) Signed-off-by: LoopX Agent <[email protected]> * perf(chat,hosts): skip frontend source re-hashing on immutable installed releases and extend readiness timeout to 90s (#9089) Signed-off-by: LoopX Agent <[email protected]> * refactor(control-plane): split and slim quota monitor_poll_commit (#8885) * refactor(control-plane): split and slim quota monitor_poll_commit Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): preserve legacy lane budget and observation diagnostic order Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * refactor(quota): slim loopx/quota.py and tighten Any count to zero (#8939) Signed-off-by: LoopX Agent <[email protected]> * refactor(native-chat): slim external_conversations below 2k lines and retire ceiling (#8911) * refactor(native-chat): move steward commission mixin to steward_commands and retire external_conversations ceiling Signed-off-by: LoopX Agent <[email protected]> * fix(native-chat): respect include_raw_response in retained result recovery Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * refactor(chat): slim chat_runtime below 1,500 lines, fix entry-point project_contexts guard, and retire ceiling (#8920) * refactor(chat): move session lifecycle mixin to session_open, deduplicate runtime helpers, and retire ceiling Signed-off-by: LoopX Agent <[email protected]> * fix(chat): drop turn_done_events slot before waking waiters on Thread.start failure Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(steward): paginate open PR signal GraphQL, allow signal-unavailable monitor recovery, and cache private delivery scans (#9093) Signed-off-by: LoopX Agent <[email protected]> * perf(lark,native_chat): back off noop recovery retries and cache recovery lookups (#9096) Signed-off-by: LoopX Agent <[email protected]> * perf(native_chat,lark): cache unchanged quota backlog health and interrupt observations (#9098) Signed-off-by: LoopX Agent <[email protected]> * perf(lark,native_chat): coalesce listener snapshots and cache recovery event summaries (#9100) Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: cicolord <[email protected]> Signed-off-by: LoopX Agent <[email protected]> Signed-off-by: huangruiteng <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: Lusen Dong <[email protected]> Co-authored-by: cicolord <[email protected]> Co-authored-by: huangruiteng <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * refactor(issue-fix): consolidate maintainer-correction admission and slim pr_lifecycle (#8897) Signed-off-by: LoopX Agent <[email protected]> * Fix truncated requests and responses in the Codex API relay (#8713) * fix(codex relay): fence incomplete model requests before drain Signed-off-by: LoopX Agent <[email protected]> * fix(codex relay): surface incomplete upstream responses Port the verified response framing fix to the request-admission branch. Original candidate 27bc3aee311cdfc6a00466ff9d3b58c7db36e01b. Signed-off-by: LoopX Agent <[email protected]> * Bound Codex relay writes to clients that stop reading Signed-off-by: LoopX Agent <[email protected]> * Reject upstream chunked responses missing the trailer terminator Signed-off-by: LoopX Agent <[email protected]> * Validate upstream chunk data delimiters before relay completion Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(release): repair dsh closeout test, antigravity failover alias, and release download retry (#9147) Signed-off-by: LoopX Agent <[email protected]> * docs(release): update v2.4.0 release notes and dsh-loopx-plugin 0.1.1-beta.7 README (#9149) Signed-off-by: LoopX Agent <[email protected]> * fix(chat): recover saved answers and diagnose lost workers (#9120) * fix(chat): recover saved answers and diagnose lost workers Signed-off-by: LoopX Agent <[email protected]> * style(lark): keep private_conversations within module line budget Signed-off-by: LoopX Agent <[email protected]> * fix(chat): retain execution_worker_exited in pending backlog count Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(chat): resume steward requests lost before dispatch (#9125) Signed-off-by: LoopX Agent <[email protected]> * fix(benchmark): restore frozen v1 archives and align checkpoint/runtime tests with C1 defaults (#9151) Signed-off-by: LoopX Agent <[email protected]> * fix(release): stabilize CLI help, architecture guards, onboarding gate, and public smokes (#9152) Signed-off-by: LoopX Agent <[email protected]> * fix(steward): recover report selection across python upgrades and prevent queue kill on observation monitors (#9155) Signed-off-by: LoopX Agent <[email protected]> * fix(release): align extensions, chat, presentation, and transport tests for v2.4.0 (#9156) Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): stabilize v2.4.0 quota, turn-envelope, and capabilities slice (Slice B1) (#9154) * fix(control-plane): stabilize v2.4.0 quota, turn-envelope, and capabilities slice Signed-off-by: LoopX Agent <[email protected]> * fix(quota): preserve tokenless identity and exact numeric types in attach_complete_turn_context Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(steward): recover frozen report contract failures and rebind resumed task leases (#9157) Signed-off-by: LoopX Agent <[email protected]> * fix(steward): recover pre-dispatch runtime failures across endpoints and stop receipt-unknown disk churn (#9159) Signed-off-by: LoopX Agent <[email protected]> * fix(control_plane): align lease recovery, settlement readback, and runtime fixtures (#9158) * fix(control_plane): align lease recovery, settlement readback, and runtime fixtures Signed-off-by: LoopX Agent <[email protected]> * fix(control_plane): forward record_capture in worker outage test and harden version type guard Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): stabilize v2.4.0 explore, context, and checkpoint tail slice (Slice B4) (#9161) Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): stabilize v2.4.0 replan, monitor recovery, and staged-read slice (Slice B5) (#9160) Signed-off-by: LoopX Agent <[email protected]> * docs(release): reconcile final v2.4.0 stabilization PRs and boundary wording (#9162) * docs(release): reconcile final v2.4.0 stabilization PRs and boundary wording Signed-off-by: LoopX Agent <[email protected]> * docs(release): align #9158 and #9161 descriptions with verified commits Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(steward): tolerate minor JSON delimiter glitches and recover saved report candidates (#9164) Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): preserve bound yardstick reversals in native replan openings (#9165) Signed-off-by: LoopX Agent <[email protected]> * fix(native-chat): recover loopback relay 401 failures and isolate test auth (#9167) Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> Signed-off-by: cicolord <[email protected]> Signed-off-by: huangruiteng <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: Lusen Dong <[email protected]> Co-authored-by: cicolord <[email protected]> Co-authored-by: huangruiteng <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
Summary
Completes LoopX
v2.4.0pre-release stabilization Slice B5 (replan,monitor recovery,staged-read,vision/budget,shadow mutant locators, andtodohelp-text alignment) cleanly on top ofmain:Control-Plane & CLI Fixes
quota_capture.py,quota_native_context.py,codex_context.py): preserve inlinesettlement_planfor explicit--capture-dir/ guided--begin-turncallers while routing non-select progressive reads cleanly through_saved_decision_reference, keeping required capture helpers exported and clearingmypytyping checks.semantic_replan_writeback.py): forwardprojected_ack(latest_autonomous_replan_ack_from_status_payload) viaautonomous_replan_ackfor guarded obligations, and extract_build_writeback_projection_contextto keepqualify_replan_writebackwithin the maintainability ratchet.unsettled_host_turn.py,unsettled_host_turn_contract.py,interaction_contract.py,quota.py): attach active hard-leaselease_proofonmonitor_pollrecovery actions viaproject_selected_todo_execution_preparation, and passcomposed_settlement=Truein_attach_auxiliary_monitor_settlement_resumewhile keeping module line andAny-count metrics within ceilings.mutants.py): updatepublic_refresh_writes_owned_paragraphbeforelocator afterstate_refresh.pyrefactoring.Test & Fixture Alignments (
17files)tests/control_plane/replan_packet_fixture.pyand the alignedtests/control_plane/test_*.pysuites in Slice B5 to match currentquota_settlement_plan_v2,loopx_turn_envelope_v1,replan_cli_view,omitUnboundExploreResultWriteback,result_writeback_guidance_ref, capture-digest checks,receipt_bound_replan_settlement,context-readstaged reads, and CLI help contracts without weakening invariants.Verification (Observed on
HEAD609aa305670098cb3037e6d2ecc3f925c03a6373)tests/control_plane/modules:496 passed(0failed,0skipped).732 passed, 10 skipped(0failed;test_quota_settlement_cli.py:218 passed, plus 10 adjacent modules:514 passed, 10 skippedpre-existing skips).npm run typecheck:control-planepassed;npm run test:control-planepassed (tests 6785,pass 6694,fail 0,skipped 91).ruff checkacross all changed.pyfiles: passed.mypy(pyproject.toml17 strict files +--follow-imports=silenton all 8 touchedloopx/files):0errors.scripts/check_rfc_bilingual.py --base origin/main --head HEAD: passed.examples/control_plane/control-plane-maintainability-ratchet-smoke.py --format=json:ok=true(unreviewed_count=0).loopx check --scan-root .:ok=true(0errors).loopx canary premerge --from-git-diff --git-diff-base origin/main: passed (selected=19,failures=0;direct_checks:6/6,catalog_run:10/10,risk_profile_run:8/8,boundary_run:1/1).cqr_93369634df5057a6b1e5(decision: "pass",receipt_valid: true, scope fingerprint93369634df5057a6b1e5a50af8880f5f0bc4886bb749db976f4c4747a9c90c45, baseddba6bf3964baa59e0d86979119aa027422d2aa5).